﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.DialogUI {
    import flash.utils.*;
    import org.aswing.*;
    import Classes.*;
    import flash.text.*;
    import org.aswing.border.*;
    import Display.aswingui.*;

    public class CharacterAdviceDialogView extends GenericDialogView {

        private var m_customButtonText:String;

        public function CharacterAdviceDialogView(_arg1:Dictionary, _arg2:String="", _arg3:String="", _arg4:int=0, _arg5:Function=null, _arg6:String="", _arg7:int=0, _arg8:String="Accept"){
            this.m_customButtonText = _arg8;
            super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
            m_acceptTextName = _arg8;
        }
        override protected function createInteriorHolder():JPanel{
            var _local15:JPanel;
            var _local1:JPanel = new JPanel(new SoftBoxLayout(SoftBoxLayout.Y_AXIS, 0, SoftBoxLayout.TOP));
            _local1.setPreferredWidth(m_bgAsset.width);
            _local1.setMinimumWidth(m_bgAsset.width);
            _local1.setMaximumWidth(m_bgAsset.width);
            var _local2:JPanel = createHeaderPanel();
            ASwingHelper.prepare(_local2);
            _local1.append(_local2);
            var _local3:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER, -20);
            var _local4:AssetPane = new AssetPane(m_assetDict["character"]);
            _local4.setBorder(new EmptyBorder(null, new Insets(10, 5, 0, 0)));
            _local3.append(_local4);
            var _local5:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER, 0);
            var _local6:AssetPane = new AssetPane(m_assetDict["divider"]);
            _local5.append(_local6);
            var _local7 = 15;
            _local3.appendAll(ASwingHelper.horizontalStrut(28), _local5, ASwingHelper.horizontalStrut(77));
            var _local8:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER, 0);
            var _local9:String = m_message;
            var _local10:JLabel = ASwingHelper.makeLabel(_local9, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 20, EmbeddedArt.blueTextColor);
            var _local11:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER, 0);
            var _local12:AssetPane = new AssetPane(m_assetDict["horizontalRule"]);
            _local11.append(_local12);
            ASwingHelper.prepare(_local11);
            var _local13:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER, 0);
            var _local14:AssetPane = ASwingHelper.makeMultilineText(ZLoc.t("Dialogs", "TrainUI_Neighbors_subText"), 300, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, TextFormatAlign.CENTER, 20, EmbeddedArt.brownTextColor);
            _local13.append(_local14);
            ASwingHelper.prepare(_local13);
            _local8.append(_local10);
            _local8.append(ASwingHelper.verticalStrut(20));
            _local8.append(_local11);
            _local8.append(ASwingHelper.verticalStrut(20));
            _local8.append(_local13);
            ASwingHelper.setEasyBorder(_local8, 0, 0, 0, 15);
            _local3.append(_local8);
            ASwingHelper.prepare(_local3);
            _local1.append(_local3);
            _local1.setBorder(new EmptyBorder(null, new Insets(0, 0, 0, 0)));
            if (m_type != TYPE_MODAL){
                _local15 = this.createButtonPanel();
                _local1.append(ASwingHelper.verticalStrut(-10));
                _local1.append(_local15);
            };
            ASwingHelper.prepare(_local1);
            return (_local1);
        }
        override protected function makeBackground():void{
            if (m_bgAsset){
                ASwingHelper.setSizedBackground(this, m_bgAsset, new Insets(0, 0, 20));
            };
        }
        override protected function setMessageTextWidth(_arg1:Boolean=false):Number{
            var _local2:Number = 284;
            return (_local2);
        }
        override protected function createButtonPanel():JPanel{
            m_acceptTextName = ZLoc.t("Dialogs", this.m_customButtonText);
            m_acceptTextName = m_acceptTextName.toUpperCase();
            var _local1:JPanel = new JPanel(new FlowLayout(AsWingConstants.CENTER));
            var _local2:CustomButton = new CustomButton(m_acceptTextName, null, "GreenButtonUI");
            _local2.addActionListener(onAccept, 0, true);
            _local1.append(_local2);
            return (_local1);
        }

    }
}//package Display.DialogUI 
